package ru.sviridov.sellandbuy;

import ru.sviridov.sellandbuy.tasks.base.BaseTask;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

public class MainActivity extends Activity {
	
	private BaseTask<?> task;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		ContentViewMapper.setContentView(this);
		
		tempLoadAds();
	}
	
	private void tempLoadAds() {
	}

	public void onClickAddAdvertising(View view){
		startActivity(new Intent(this, NewAdvertisingActivity.class));
	} 

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		super.onCreateOptionsMenu(menu);
		getMenuInflater().inflate(R.menu.page_main, menu);
		return true;
	}
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		if(item.getItemId()==R.id.menu_profile){
			startActivity(new Intent(this, ProfileActivity.class));
			return true;
		}

		return super.onOptionsItemSelected(item);
	}
}
